Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for clap::helpers::Host #50

Merged
merged 4 commits into from
Jan 19, 2024
Merged

Conversation

Trinitou
Copy link
Contributor

No description provided.

@Trinitou Trinitou changed the base branch from main to next January 19, 2024 00:31
@@ -428,15 +428,15 @@ namespace clap { namespace helpers {
///////////////
template <MisbehaviourHandler h, CheckingLevel l>
Host<h, l> &Host<h, l>::from(const clap_host *host) noexcept {
if constexpr (l >= CheckingLevel::Minimal) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ouch, maybe it is time to require C++17? ;-)
It is 2024 so it is already 7 years old.

Copy link
Contributor Author

@Trinitou Trinitou Jan 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I would be fine with that
Maybe @baconpaul can tell? My original idea was to use clap::helpers::Host for clap-wrapper as well. So it should meet the requirements there, too. I think somewhere I read that they wrote something like "c++17 min" but just want to ensure that it would be OK.

The CMakeLists.txt defaulted to 11 before we started upgrading it recently and still does I think. So I guess we would have to change it there as well (?)
(edit: I justed looked it up: at least the clap-helpers-tests default to 11 so that it looks like it is the minimum.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok just removed the CLAP_IF_CONSTEXPR
We can solve the rest (c++11 etc) later


#include <catch2/catch_all.hpp>

template class clap::helpers::Host<clap::helpers::MisbehaviourHandler::Terminate,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we want to use a macros to expand all the combinations?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea, maybe in a later PR?

@abique
Copy link
Contributor

abique commented Jan 19, 2024

Thanks the PR looks good except the CLAP_IF_CONSTEXPR.
I can't explain it well, but it triggers a warning when I see it.
I think that hiding a native construction like if behind a macros is maybe the thing that triggers it.

As of today C++17 is well supported on Windows, macOS and Linux, maybe we just upgrade the requirement?

@abique abique merged commit 62824ef into free-audio:next Jan 19, 2024
12 checks passed
@Trinitou Trinitou deleted the add-host-tests branch January 24, 2024 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants